import { http } from "@/utils/http";

export interface InsertSightInfo {
  title: string;
  slogan: string;
  poiId: number;
  score: number;
  hot: number;
  address: string;
  mainImg: string;
  isShow: number;
  isOpen: number;
  imgList: string[];
  ticketInfo: TicketInfo;
  openTime: string;
  suggest: Suggest;
}

export interface TicketInfo {
  ticketRule: string;
  ticketPrice: string;
  ticketDiscountInfo: string;
}

export interface Suggest {
  travelSuggest: string;
  sightSuggest: string;
  defectSuggest: string;
  disclose: string;
}

export interface UpdateSightById {
  id: number;
  title: string;
  slogan: string;
  poiId: number;
  score: number;
  hot: number;
  address: string;
  mainImg: string;
  isShow: number;
  isOpen: number;
  imgList: string[];
  ticketInfo: TicketInfo;
  openTime: string;
  suggest: Suggest;
}

export interface RemoveSightInfoById {
  id: number;
}

export interface EnableSightInfoById {
  id: number;
}

export interface QuerySightDetailById {
  sightId: number;
}

export interface SightDetailVO {
  id: number;
  title: string;
  slogan: string;
  poiId: number;
  province: string;
  city: string;
  score: number;
  hot: number;
  address: string;
  mainImg: string;
  source: number;
  isShow: number;
  isOpen: number;
  imgList: string[];
  ticketInfo: TicketInfo;
  openTime: string;
  suggest: Suggest;
}

export interface SightBaseVO {
  id: number;
  title: string;
  poiId: number;
  province: string;
  city: string;
  score: number;
  hot: number;
  mainImg: string;
  isShow: number;
  isOpen: number;
}

export interface QuerySightInfoByCondition extends BizPageReq {
  id: number;
  title: string;
  poiId: number;
  province: string;
  city: string;
}

//新增景点详情信息
export const insertSightInfoApi = (data: InsertSightInfo) => {
  return http.request<BizResponse<Boolean>>("post", "/sight/insertSightInfo", {
    data
  });
};

//更新景点详情信息
export const updateSightByIdApi = (data: UpdateSightById) => {
  return http.request<BizResponse<Boolean>>("post", "/sight/updateSightById", {
    data
  });
};

//根据主键删除景点详情信息
export const removeSightInfoByIdApi = (data: RemoveSightInfoById) => {
  return http.request<BizResponse<Boolean>>(
    "post",
    "/sight/removeSightInfoById",
    { data }
  );
};

//启禁用景点详情信息
export const enableSightInfoByIdApi = (data: EnableSightInfoById) => {
  return http.request<BizResponse<Boolean>>(
    "post",
    "/sight/enableSightInfoById",
    {
      data
    }
  );
};

//查询景点详情信息
export const querySightDetailByIdApi = (data: QuerySightDetailById) => {
  return http.request<BizResponse<SightDetailVO>>(
    "post",
    "/sight/querySightDetailById",
    {
      data
    }
  );
};

//多条件查询景点详情信息
export const querySightInfoByConditionApi = (
  data: QuerySightInfoByCondition
) => {
  return http.request<BizPageResponse<BizPageResult<SightBaseVO>>>(
    "post",
    "/sight/querySightInfoByCondition",
    {
      data
    }
  );
};
